<?php

namespace console\migrations;

use console\migrations\Base;

/**
 * Handles the creation of table `{{%ticket}}`.
 */
class M200810010653CreateTicketTable extends Base
{

    protected string $tableName = '{{%ticket}}';
    protected string $tableComment = '';

    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable( $this->tableName, [
            'id'        => $this->primaryKey(),
            'title'     => $this->string( 255 )->notNull(),
            'code'        => $this->integer( 11 )->notNull()->defaultValue( 0),
            'rs'        => $this->integer( 11 )->notNull()->defaultValue( 0),
            'detail' => $this->text(),
            'created_at'  => $this->dateTime(),
            'updated_at' => $this->dateTime(),
        ], $this->tableOptions );
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable( '{{%ticket}}' );
    }
}
